<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>发表</title>
<link rel="stylesheet" type="text/css" href="__static__/css/style.css" />
<script src="__static__/js/cufon-yui.js" type="text/javascript"></script>
<script src="__static__/js/Pristina_400.font.js" type="text/javascript"></script>

<script type="text/javascript">
	Cufon.replace('h1');
	Cufon.replace('.contact_row label');
</script>
</head>
<body>
{include file="./public/user/head.html" /}
<div style="margin-left: 70.2%;margin-top: 14%;">
    <button onClick="history.go(-1)" style="border: none;background-color: transparent">
        <font color="#8b4513" size="4" style="border: #633a1c;font-style: italic">返回</font>
    </button>
</div>
<div id="main_container" style="margin-top: -250px">
    <div class="contact_form">
		<h1>welcome to say,</h1>
        <div class="contact_row">
            <label>title:</label>
            <input type="text" id='title' class="contact_input" />
        </div>
        <div class="contact_row">
            <label>say:</label>
            <textarea class="contact_textarea" id="content"></textarea>
        </div>
        <div class="contact_row">
        <input type="image" src="__static__/images/send.gif" class="contact_submit" id="send" />
        </div>
    </div>
</div>
</body>
<!--发表留言-->
<script>
    $(function () {
        $('#send').click(function () {
            var title = $('#title').val();
            var content = $('#content').val();
            //验证签名
            sign.params = {
                title:title,
                content:content
            }
            var encode_data = sign.encode_post();
            console.log(encode_data);
            $.post(url_list.mes_add,encode_data,function (data) {
                //解码
                if(typeof data == 'string'){
                    data = eval('('+data+')');
                }
                data = sign.decode_post(data);
                console.log(data);
                //返回数组
                if(data.code==200){
                    var r=confirm("发表成功，确定查看留言？？？");
                    if (r==true)
                    {
                        location.href=url_list.user_index;
                    }
                    else
                    {
                        location.href=url_list.mes_index;
                    }
                }
                else{
                    alert(data.msg);
                }

            },'json')
        })
    })
</script>

<!--<script>
    &lt;!&ndash;退出&ndash;&gt;
    function logout() {
        location.href = url_list.logout;
    }
    &lt;!&ndash;个人中心&ndash;&gt;
    function info() {
        location.href=url_list.user_info;
    }
</script>-->
</html>